let regMeeting = /(?<id>(\w+?)-(\d{13}))/i;
let regMeetingTime = /\w+?-(\d{13})$/i;
let m = require('moment');
let metaxml = require('./class/metaxml');
let folder = require('./folder');

module.exports = {
    folder,
    getMeetingTime,
    getMeetingID,
    getMetaObject
};

/**
 * 返回 moment 时间
 * @param meetinID
 * @return {Date}
 */
function getMeetingTime(meetinID) {
    if (regMeetingTime.test(meetinID)) {
        return m(RegExp.$1 * 1);
    }
}

/**
 * 返回meetingID
 * @param path
 * @return {string}
 */
function getMeetingID(path) {
    if (regMeeting.test(path)) {
        return RegExp.$1;
    }
}

function getMetaObject(file) {
    let xmlobj = new metaxml(file);
    return xmlobj;
}

